package com.mapper;

import com.pojo.Orders;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author xiexin
 * @description 针对表【tb_orders】的数据库操作Mapper
 * @createDate 2024-11-15 15:41:52
 * @Entity com.pojo.Orders
 */
public interface OrdersMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Orders record);

    int insertSelective(Orders record);

    Orders selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Orders record);
* @description 针对表【tb_orders】的数据库操作Mapper
* @createDate 2024-11-15 15:41:52
            * @Entity com.pojo.Orders
*/
    public interface OrdersMapper {

        int deleteByPrimaryKey(Long id);

        int insert(Orders record);

        int insertSelective(Orders record);

        Orders selectByPrimaryKey(Long id);

        int updateByPrimaryKeySelective(Orders record);
        @Select("select * from tb_orders where user_id=#{id}")
        @Results({
                @Result(id=true,column = "id",property = "id"),
                @Result(column = "number",property = "number")
        })
        List<Orders> selectOrdersByUserId(int id);
    }
